package com.huatai.bpmn.controller;

import com.alibaba.fastjson.JSONObject;

import com.huatai.bpmn.service.TbCommitService;
import com.huatai.common.api.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gusiyi
 * @version 1.0
 * @className TbCommitController
 * @description 描述：
 * @date 2023/8/7 15:26
 */
@RestController
@RequestMapping("/tbCommit")
@Api(value = "审批执行controller", tags = "审批执行controller")
@Slf4j
public class TbCommitController {

	@Autowired
	private TbCommitService tbCommitService;

	@PostMapping("testOne")
	@ApiOperation(value = "测试逻辑")
	public R<Object> testOne(@RequestBody JSONObject requestBody){
		String deployKey = requestBody.getString("deployKey");
		JSONObject data = requestBody.getJSONObject("data");
		return R.data(tbCommitService.commit(deployKey,data));
	}


}
